package com.simple.security.config;


import com.mmm.station.security.entity.Manager;
import com.mmm.station.security.method.Realm;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by mmm on 2016/12/7.
 */
@Configuration
public class MSecurity {


    @Bean
    public Manager manager(){
        Manager manager = new Manager();
        manager.setRealm(getMyRealm());
        manager.setResponseType("json");
        manager.setAuthJsonContent("没有认证");
        manager.setPermissionJsonContent("没有权限");
        return manager;
    }
    @Bean
    public Realm getMyRealm(){
        return new MyRealm();
    }
}
